1. Field of the Invention
The present invention relates to highly available file systems. More specifically, the present invention relates to a method and apparatus for facilitating a failover to a secondary file server upon failure of a primary file server in a highly available file system.
2. Related Art
Highly available file systems allow a client to continue accessing files from a storage device when a primary file server for the storage device fails or otherwise becomes inaccessible. Highly available file systems typically make use of multiple file servers that are coupled to one or more multi-ported storage devices. During operation, one file server is designated as the primary file server. This primary file server services all requests to access files on the storage device. The other file servers act as backup secondary file servers, which do not normally access the storage device. The primary file server periodically sends checkpoint information to the secondary file servers. This allows the secondary file servers to maintain copies of state information from the primary file server.
When the primary file server subsequently fails or otherwise becomes inaccessible, a secondary file server is promoted to act as a new primary file server. This process of promoting a secondary file server to act as a new primary file server is referred to as a “failover.” Promoting the secondary file server allows operations in progress to complete or to be automatically retried.
In some operating systems, a primary file server maintains file objects, which contain a pointer to a virtual node (vnode). A vnode holds state information that is used to access the file on the underlying file system. The secondary file server also maintains file objects. However, instead of including pointers to vnodes, these file objects include pointers to file identifiers (FIDs). FIDs can be used to identify a file on the storage device. However, an FID must first be converted to a vnode before the file can be accessed.
Hence, during a failover operation, the new primary file server must convert FIDs to vnodes. This can be an extremely slow process because a large number of FIDs may have to be converted to vnodes, and furthermore, each conversion may require an access to the storage device. During this conversion process, the new primary file server cannot accept new file requests. This can cause long waits for client applications that need to access the file system, which result in timeouts or other failures.
What is needed is a method and an apparatus that facilitates failover to a secondary file server in a highly available file system without the problems described above.